<?php
require_once("dao/DAOFactory.php");
require_once("bizlayer/IBiz.php");

class CourseMgmt implements IBiz{
	static $dao;
	public static function initializeDao(){
		self::$dao = DAOFactory::getDAO("course");
	}
	
	public static function searchCourses($venueId,$courseName,$deleted){
		self::initializeDao();
		return self::$dao->searchCourses($venueId, $courseName, $deleted);
	}
	public static function getCourseListByVenueId($venueId){
		return self::searchCourses($venueId, null,0);
	}
	public static function getAllCourses(){
		return self::searchCourses(null, null, 0);
	}
	public static function getCourse($courseid){
		self::initializeDao();
		return self::$dao->getItem($courseid);
	}
	
	public static function updateCourse($course){
		self::initializeDao();
		self::$dao->saveItem($course);
	}
	
	public static function deleteCourse($courseid){
		self::initializeDao();
		self::$dao->deleteItem($courseid);
	}
}
?>